package GameEngine.Gui;

import processing.core.PImage;
import GameEngine.Gui.Event.TouchEvent;
import GameEngine.helper.PAppletBridge;

public class Screen {
	private Form F;
	private PImage hintergrund;
	private PImage forward;
	private PImage backward;

	boolean active = false;

	public Screen(Form f) {
		F = f;
		hintergrund = PAppletBridge.loadImage("bm.png");
		forward = PAppletBridge.loadImage("forward-button.png");
		backward = PAppletBridge.loadImage("backward-button.png");
	}

	public void draw() {
		PAppletBridge.background(hintergrund);
		F.draw();

		PAppletBridge.stroke(255);
		PAppletBridge.line(0, F.FC.z8, PAppletBridge.width, F.FC.z8);
		PAppletBridge.textAlign(PAppletBridge.LEFT);
		PAppletBridge.image(backward, 20, F.FC.z8 + 5);
		PAppletBridge.image(forward, PAppletBridge.width - 85, F.FC.z8 + 5);
	}

	public void setActive(boolean a) {
		this.active = a;
	}

	public boolean isActive() {
		return active;
	}

	public void handleEvent(TouchEvent e) {
		if (active) {
			F.handleEvent(e);
		}
	}
}
